package cn.tedu.boot41.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BMIController {
    @RequestMapping("/bmi")
    public int bmi(float height, float weight) {
        float bmi = weight / (height * height);
        if (bmi < 18.5) {
            return 1;
        }
        if (bmi < 24) {
            return 2;
        }
        if (bmi < 28) {
            return 3;
        }
        return 4;

    }
}
